package org.karelun.rabbit.rcp.property.tab;

import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.karelun.rabbit.graph.Texted;

public class TabPropertyLabelProvider extends LabelProvider {
	
	@Override
	public String getText(Object element) {
		if(element instanceof IStructuredSelection){
			Object ele = ((IStructuredSelection)element).getFirstElement();
			if(ele instanceof Texted){
				return ((Texted)ele).cdoID().toURIFragment();
			}
		}
		return super.getText(element);
	}

	@Override
	public Image getImage(Object element) {
		// TODO Auto-generated method stub
		return super.getImage(element);
	}
}
